import request from "@/utils/request";

/**
 * 获取商品详情
 * @param {String} id - 商品ID
 */
export const getProduct = (id) => {
  return request({
    method: "GET",
    url: `/goods?id=${id}`,
  });
};
/**
 * 获取同类商品推荐
 * @param {String} id - 商品ID
 */
export const getRelevant = (id, limit) => {
  return request({
    method: "GET",
    url: `/goods/relevant?id=${id}&limit=${limit}`,
  });
};
/**
 * 获取商品的评价统计信息
 * @param {String} id - 商品ID
 */
export const getCommentInfo = (id) => {
  return request({
    method: "GET",
    url: `/goods/${id}/evaluate`,
  });
};

/**
 * 获取商品的评价统计信息
 * @param {String} id - 商品ID
 */
 export const getCommentList = (id, params) => {
    return request({
      method: "GET",
      url: `/goods/${id}/evaluate/page`,
      params
    });
  };